9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to modify a bash script to to take each line in a file and execute command. I currently have this:
#!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Discussion started by: galford
3 Replies
2. Shell Programming and Scripting
I have a simple task to replace unix line feed end of line characters with carriage returns.
When I run the following “change file in place” sed instruction from the command line all the Line feeds are successfully replaced with Carriage returns.
sed -i 's/$/\r/' lf_file.txt
But that same... (1 Reply)
Discussion started by: hawkman2k
1 Replies
3. Shell Programming and Scripting
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
4. Shell Programming and Scripting
Hi,
As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
Discussion started by: armando110
3 Replies
5. Shell Programming and Scripting
please help me to execute a simple shell script like
for i in `ls
echo $i
done
. i dont want to create a new sh file to execute it. Can i just type and execute it ? because I always this kind of simple for loops .
Please help .
Thanks (7 Replies)
Discussion started by: Sooraj_Linux
7 Replies
6. Shell Programming and Scripting
I am newbie in UNIX, so please excuse me for the stupid question.:)
Here is a problem:
I created ksh script where the part of the functionality include an opening of a second session with another shell process "runrep"(runrep is a custom reporting shell designed by Advent Geneva).
When I run my... (3 Replies)
Discussion started by: alexstar
3 Replies
7. Shell Programming and Scripting
Hi,
I have a file abcd.txt which in turn contains 20 file names as column 1.
Now I want to run a command "ct co -nc" / "cp" / "mv" on each of these $1 column content i.e. on each of the 20 file names.
How can do this using a script so that I need not run the same command 20 times... (13 Replies)
Discussion started by: royzlife
13 Replies
8. Shell Programming and Scripting
Hi,
I have the following text file:
8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm
11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies
9. Shell Programming and Scripting
How do I execute a command containing a double quote ?
I pass a variable to grep that contains spaces, so I need to quote it,
but it does not work.
#!/usr/bin/ksh
set -x
txt='"next to"'
cmd="grep $txt ~dpearso5/file2"
echo $cmd
$cmd
This is the error I get:
+ grep "next to"... (1 Reply)
Discussion started by: pearson05
1 Replies