FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Install

LinkBack Thread Tools
Old 04-16-2008, 06:05 PM
"a s p a s i a"
Default how to grab command line arguments in /bin/nash?


Am a RHEL noob, so pls excuse the naive question; Wanted to find out
if anyone has attempted to customize/edit your initrd's init script;
what I'd like to do is to be able to:

1. grab the /proc/cmdline arguments passed on during a pxeboot of a
diskless station
2. parse the commandline into variable so I can use to pass as
argument to a service that's called within the current init script.

Is this possible using /bin/nash? if so, how?

Example (snippet of init script)

- currently does this

echo Attaching to iSCSI storage
/bin/iscsistart -t iqn.2008-04.com.mylab.foo3:storage.foo -i
iqn.1994-05.com.redhat:a950ce57a2bb -g 1 -a

- I'd like to:
a. grab commandline parameters pass from the "APPEND" line in the
pxelinux.cfg/<configuration file>
b. place it in variable, so that I can simply edit the above command
and use the appropriate "target" value.

c. In bash, it would look something like this:

var=` cat /proc/cmdline | cut -d " " -f6 | cut -d "=" -f2`
echo Attaching to iSCSI storage
/bin/iscsistart -t $var -i iqn.1994-05.com.redhat:a950ce57a2bb -g 1 -a

I am a linux newbie, and just realized that /bin/nash is really not
like bash ... any help or advise on how I can grab a commandline when
running the intrd's init script?

thanks in advance,

. . . . . . . . . . ..

Redhat-install-list mailing list
To Unsubscribe Go To ABOVE URL or send a message to:
Subject: unsubscribe

Thread Tools

All times are GMT. The time now is 05:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org