10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
SUSE linux
bash shell
this works
test -d /tmpp && echo "directory exists" || echo "directory doesn't exists" |sed -e "s/^/prefix /"
prefix directory doesn't exists
but why doesn't this work?
test -d /tmp && echo "directory exists" || echo "directory doesn't exists" |sed -e... (3 Replies)
Discussion started by: snoman1
3 Replies
2. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
3. Shell Programming and Scripting
i need to substitute word on a specific line.
I was able to do it on command line like below but it is not working in vi.
command line like below:
sed -e '8s/table_name/schema.table_name/' file_name.
in vi table_name and schema are my positional parameters that i pass into the
script.
... (5 Replies)
Discussion started by: pimmit22043
5 Replies
4. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
5. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
6. Shell Programming and Scripting
Hey all,
I am trying to disable a certain cronjob before I run a backup. I want to be able to add/remove a "#" from the beginning on the crontab line it is located on.
Here is the crontab:
46 11 * * * /etc/webmin/cron/tempdelete.pl
@daily /etc/webmin/time/sync.pl
*/5 * * * *... (4 Replies)
Discussion started by: eg mike
4 Replies
7. Shell Programming and Scripting
hi All,
cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'
Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies
8. Shell Programming and Scripting
Input: a/b/c
Output required: a\/b\/c
This does not work:
sed s/'\/'/'\//'/g (6 Replies)
Discussion started by: indianjassi
6 Replies
9. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
10. Shell Programming and Scripting
Hello all,
I have a weird issue when trying to substitute the slashes into backslashes.
If I execute this on the command-line (bash / ksh) I get the path correctly translated with backslashes instead of slashes.
> echo $PWD | sed 's/\//\\/g'
However, when I put this in my script to... (3 Replies)
Discussion started by: candyflip2000
3 Replies