10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to handle some files with spaces in their name using "" or \ . Like "file 1" or file\ 1.
My current confusion can be expressed by the following shell script:
#!/bin/bash
touch "file 1" "file 2"
echo -n "ls: " ; ls
echo ---
for file in "file 1" "file 2" ; do
echo $file... (9 Replies)
Discussion started by: Ralph
9 Replies
2. Shell Programming and Scripting
I am using the below bash loop:
or f in /media/cmccabe/My Book Western Digital/10_29and30_2015/*.bam ; do
bname=`basename $f`
pref=${bname%%.bam}
samtools view -H $f | sed '/^@PG/d' | samtools reheader - $f > /home/cmccabe/Desktop/NGS/${pref}_newheader.bam
done
is the... (1 Reply)
Discussion started by: cmccabe
1 Replies
3. UNIX for Advanced & Expert Users
Hi All,
Iam trying to get a file processed and some lines have spaces...the below is not working
Want to remove empty line
Want to remove lines that start with #
Avoid line with substring WHOA
When trying to get the substring from the var also Iam having trouble
file is like VAR=VALUE,... (13 Replies)
Discussion started by: baanprog
13 Replies
4. UNIX for Dummies Questions & Answers
Hi
I'm trying to ensure that I have catered for all situations with my getopt cases.
One other situation I want to cover is should the user enter the script without any preceding arguments eg:
./script_eg
I need the script to the direct the user to the helpfile
I have tried... (3 Replies)
Discussion started by: ladyAnne
3 Replies
5. Shell Programming and Scripting
Hi,
I am trying to replace a specific column values in a csv file with double quotes when I am find embedded spaces with in the fields.
Example:
SNO,NAME,ZIPCODE,RANK,SEX,ADDRESS
1,Robert,74538,12,34, M,Robert Street, NY
2,Sam,07564,13,M,12 Main Ave, CA
3,Kim, Ed,12345,14,M,123D ,... (1 Reply)
Discussion started by: techmoris
1 Replies
6. UNIX for Dummies Questions & Answers
I am getting an error while trying to access a directory created with spaces in between, i couldn't able to login into that directory could you please suggest me what should i do to access that directory or if i want to rename that directory what should i do.
Directory Name:
MH PLR 2005... (1 Reply)
Discussion started by: Ariean
1 Replies
7. Shell Programming and Scripting
I need to clean out some application subdirectories from backup scripts we used to rename to various backup extensions just in case the script failed in production and we need to rollback. I will be moving these old scripts to a staging directory and then removing them after 30 days (I have the... (9 Replies)
Discussion started by: tekster757
9 Replies
8. Shell Programming and Scripting
Hi,
I am using bash script
I want some help in handling loops in my script...
I need to check for a specific interval of time whether a file in a paritcular directory exists. If exists, i need to do some action and continue with the next iteration..
//my script
attempt=0... (1 Reply)
Discussion started by: borncrazy
1 Replies
9. Shell Programming and Scripting
The script below was written to select files and convert a particular string to something other and replace that file. However, I came across some issues with filenames that contain spaces, any suggestions to get around this? Any other suggestions that may apply to this code would also be... (5 Replies)
Discussion started by: Shakey21
5 Replies
10. Shell Programming and Scripting
I am testing a ksh script for email. In the script I receive several parameters. One of them is a subject. The subject may contain spaces. Ex. Test this. When I am running the script on telnet to test, how should the syntax at the command line be written. I have this:
ksh ResendE.sh '001111'... (2 Replies)
Discussion started by: supercbw
2 Replies