Search Results

Search: Posts Made By: usrrenny
6,224
Posted By wisecracker
Your 'NOP' : is just that a 'NOP' with a...
Your 'NOP' : is just that a 'NOP' with a meaningless argument of $(./return.sh) so its RC will always be zero, '0'.
[Prompt]./return.sh 2>&1 > /dev/null
[Prompt]echo "$?"
This will suppress...
6,224
Posted By ctac_
If you don(t want the output of return.sh no...
If you don(t want the output of return.sh
no need of :
: [...]
The null command. Exit status is set to zero.
you can try this way
./return.sh >/dev/null;echo reply is $?
4,186
Posted By bigsanch
If the string is allways the same structure, then...
If the string is allways the same structure, then you can do something like this:


string1='a.sh start time is Fri Jan 9 17:17:33 CST 2015';
string1=${string1%* CST 2015}
string1=${string1##*...
4,186
Posted By Don Cragun
This will probably work for about half of a...
This will probably work for about half of a year's input assuming that all lines are in exactly the same format and that the CST is referring to US Central Standard timezone. It won't work when...
4,186
Posted By Don Cragun
You can't have a space between the variable= and...
You can't have a space between the variable= and the value to be assigned to that variable. The syntax you used, sets st to an empty string and includes it in the environment of the command that...
4,345
Posted By Chubler_XL
By not working what do you mean is the data all...
By not working what do you mean is the data all still on one line?

Are you inserting the contents of temp.txt into the email body, or attaching it to the email, I'm assuming your inserting it into...
4,345
Posted By Chubler_XL
OK that explains things. Files in...
OK that explains things.

Files in Windows/DOS are different to unix, they need \r\n on the end. Change your printf commands to put \r infront of any \n eg:

printf "%s %s\r\n" "${File[i]}" ...
4,345
Posted By DGPickett
In CSV:a,a.txt\r b,b.txt\r c,c.txt\r Tab...
In CSV:a,a.txt\r
b,b.txt\r
c,c.txt\r
Tab separated text is also well supported, without worries about ',' and '"'. But CSV is more robust, allowing you to put multi-line chunks into cells inside...
4,345
Posted By Don Cragun
Try: #!/bin/ksh arr=(a b c) for i in...
Try:
#!/bin/ksh
arr=(a b c)
for i in "${arr[@]}"
do printf '%s %s\n' "$i" "${i}.txt"
done > file
4,345
Posted By Chubler_XL
Why not create two arrays member and file ...
Why not create two arrays member and file

#!/bin/ksh
member=(a b c)
file=(1.txt 2.txt 3.txt)

i=0
while [ $i -lt ${#member[@]} ]
do
printf "%s %s\n" "${member[i]}" "${file[i]}"
let...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy