Ideally i would like obtain that information using only bash ... or bash+sed or bash+awk but i don't known if is possible so, for the moment, i used bash+grep+cut.
The final project will be an automatic menu generator for pekwm and, i hope, even for icewm.
If is possible i would like obtain that information using only the language that i specify above because i don't want use big languages (i means big package as perl, python, etc).
The final stage will be a test even on openbsd.
Note:
This is the second day that i'm broken my head on the wall.
Those are not single quotes but backquotes, also called a grave accent mark. Usually to the left of the number 1 key. You can also do this which handles nesting commands better:
Actually, save a process and useless use of cat:
The `ls ...` command substitution in the for loop will mangle any filenames containing IFS characters (by default, space, tab, and newline). Perhaps that's related to your breakage.
How to run several bash commands put in bash command line without needing and requiring a script file.
Because I'm actually a windows guy and new here so for illustration is sort of :
$ bash "echo ${PATH} & echo have a nice day!"
will do output, for example:... (4 Replies)
hello, i am facing some issue. I am using a simple bash script that via sshpass put a command into router. Now, problem is that i have a file and commands into it.
sshpass -p $pass ssh -o $log -n $user@$h /ip address set address=10.0.0.1/24
so if I have that command ip address set ... (0 Replies)
I can not figure out how to capture the $filename variable store by the bash.
#!/bin/bash
# oldest folder stored as variable for analysis, version log created, and quality indicators matched to run
dir=/home/cmccabe/Desktop/NGS/test
find "$dir" -maxdepth 1 -mindepth 1 -type d -printf... (5 Replies)
Hi,
i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues.
Src file(jjj.txt)
-------... (8 Replies)
I have the following script used, i am new to shell scripting. tryign to understand.
in the put $BASE_FOLDER/$base_name holds which path.
What does it mean by $1
second path in put command is it constructing this path: /user/hive/warehouse/stage.db/$1
what is $1 holding in above path.
... (2 Replies)
Hi
here is my code
for i in `ls *.cmd`
do
msg
aaa imp -U$AAAUSER -P$AAAUSERPWD <$i>>$curdir/import_tap.out -Jutf8
done
I can only get all files with .cmd extension. what i need to get are all the files inside the specific folder
Thanks (2 Replies)
This should be extremely simple and someone will probably answer it in .5 seconds. I need to know what:
VARIABLE=${0##*/}
does? I do not have a shell handy to just try it in. I am reading through some scripts and need to understand this line. Any help is appreciated.
Many thanks!
-... (3 Replies)
Hi all,
Is there a simple way to read a command output as a variable? I've running a batch file to do:
attrib.exe * | find /c /v "" >filecount.txt
but rather than write it to the txt file I'd like to read the total in as a variable to pass to the rest of the bat file...
Any help much... (1 Reply)
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
Hi,
Let say I have these 3 files (state, list and myscript). I want to be able get the sample output like below when I run myscript. Any one know how to fix the code? TIA.
~~~~~~~~~~~~~~~
> cat /home/state
CA
> cat /home/list
CA 100 50 20
AUS 120 61 10
> cat myscript... (6 Replies)