10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to be able to use a sed command as a variable in a bash script. I have the sed command that almost works the way I want it. the command is
sed -n '/inet/,/}/p' config.boot
This gets me this result:
inet 192.168.1.245
}
I need to get the IP address into a variable so I... (9 Replies)
Discussion started by: edlentz
9 Replies
2. Shell Programming and Scripting
Hi,
I would like to run following code in bash inside a zsh script. (In this case is output unfortunately very different if you run it in zsh).
I tried to put "bash" in front of the code but I obtained following error message "bash: do: No such file or directory
" eve though I merged the whole... (7 Replies)
Discussion started by: kamcamonty
7 Replies
3. Shell Programming and Scripting
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
Just have a requirement, I am executing a bash shell script, my requirement is to catch the pid and job name to a txt file in the same directory, is there anyway to do it? please help me out.
Regards
Rahul
---------- Post updated at 08:42 AM ---------- Previous update was at... (2 Replies)
Discussion started by: rahulkalra9
2 Replies
5. Shell Programming and Scripting
Hello.
This part of script do nothing but no complain.
Here the directory content :
The script run by root
cd /root
CMD="rmdir -p -v --ignore-fail-on-non-empty .ssh"
echo $CMD
$CMD
The ouput
linux:~/bin # ./test_05
rmdir -p -v --ignore-fail-on-non-empty .ssh
rmdir: removing directory,... (3 Replies)
Discussion started by: jcdole
3 Replies
6. Shell Programming and Scripting
There's a JavaScript file that I call from command line (there's a framework) like so:
./RunDiag.js param1:'string one here' param2:'string two here'
I have a shell script where I invoke the above command. I can run it in a script as simple as this
#!/bin/bash
stuff="./RunDiag.js... (4 Replies)
Discussion started by: AcerAspirant
4 Replies
7. Programming
Hello experts
I want to execute a awk command, which reads from txt files and sums the numbers from the first column for those listed only inside a <init> block -- The awk command is like
awk '/<\/?init>/{x = !x}x{a++}x && a > 2{sum+=$1}END{printf"%E" "\n", sum}
So, I want to execute... (2 Replies)
Discussion started by: Alkass
2 Replies
8. Shell Programming and Scripting
Just learning scripting. I need to remove duplicate managed printers using lpadmin. I have the following script (it's rough and probably a better way to do it) that returns the values as IP (column 1) Printer Name (column 2).command:
lpstat -v | grep -E ... (6 Replies)
Discussion started by: Zookpr
6 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I have scheduled a script in cron which writes output to the below file.
....>> /data/Target/wrapper_invoke_ds_job_`date '+%Y%m%d'`.ksh_out 2>&1
But the date command is not getting resolved in the format specified. It just resolves to the following.
wrapper_invoke_MQ_ds_job_Tue... (3 Replies)
Discussion started by: pkm_oec
3 Replies
10. Shell Programming and Scripting
I have a file (email) containing email addresses.
I have a second file (terms) that contains simple regular expressions and words/characters. Here are some examples:
\.trainee
\.group
\.web
I want to go through email and delete lines containing the expressions/words from terms and write... (1 Reply)
Discussion started by: manouche
1 Replies