10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I wish to grep everything before the last "/bin" in the following string
/opt/app/bin/app1/jdk150_07/bin/IA64N/java
Desired output: "/opt/app/bin/app1/jdk150_07"
Kindly help ... (2 Replies)
Discussion started by: mohtashims
2 Replies
2. Shell Programming and Scripting
Hi,
Consider the data (FS = |):
1| England |end
2| New Zealand |end
3|Australia|end
4| Some Made Up Country |end
5| West Indies|end
I want the output to be (i.e. without the leading and trailing white space from $2)
England
New Zealand
Australia
Some Made Up Country
West... (4 Replies)
Discussion started by: Storms
4 Replies
3. Shell Programming and Scripting
Okay, I am trying to make a bash script to get a certain domains IP address (my home ip). My home is on a DHCP lease from my ISP, so I cannot always trust the IP address to remain constant.
This is what I have so far for it:
alias ip-home="ping -c 1 example.com | grep 'PING' | cut -d'(' -f2 |... (5 Replies)
Discussion started by: tnanek
5 Replies
4. Shell Programming and Scripting
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies
5. Programming
I am coding a C program to read a plain text file. There are a lot of blank fields or a string with white spaces. I want to know is there such a function called trim() in C to clean the white space around a string? Or some other way can do this efficiently? Thanks. (18 Replies)
Discussion started by: hxm1303
18 Replies
6. Shell Programming and Scripting
Hi All,
I am using trim in my code..
ID_SA_SOURCE="`echo "$data" | cut -c17-34 | tr -s " "`"
ID_SA_DEST="`echo "$data" | cut -c35-52 | tr -s " "`"
echo"$ID_SA_SOURCE";"$ID_SA_DEST";
the output is
0608166896; 3001339; contains one whitespace between the two ..how can i remove that single... (3 Replies)
Discussion started by: scorpio
3 Replies
7. Shell Programming and Scripting
I want to delete all lines from 1 till a certain line.
how to do that without redirection to another file (tail solution)?
thanx (6 Replies)
Discussion started by: melanie_pfefer
6 Replies
8. Shell Programming and Scripting
Hello,
I am passing a filename to a script to draw parameters from it. However, I want to use part of the filename as a parameter. The filename is transfer_ccf_3731_10.sh but I only need the 3731_10 part of it.
Is this possible? Any help or suggestions would be appreciated!
Regards,
J. (4 Replies)
Discussion started by: JWilliams
4 Replies
9. Shell Programming and Scripting
I'm trying to find a command that will trim the white space off a string.
e.g.
$str = " stuf "
$str = trim ( $str )
echo $str // ouput would just be stuf
Thanks, Mark (4 Replies)
Discussion started by: msteudel
4 Replies
10. Shell Programming and Scripting
Hi ,
I have a code like this:
uid=scott
password=tiger
database=db01
cat >runid_val.sql<<-EOA
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SELECT trim(runid_seq.nextval) FROM dual;
EXIT
EOA
echo `cat runid_val.sql`
V_RUNID=`sqlplus -s $uid/$password@$database @runid_val.sql`... (5 Replies)
Discussion started by: vj_76
5 Replies