02-17-2017
Just guessing that you are not running a (recent) bash for your "substring expansion" ${firstLine:0:3} as it is the usual syntax and should work. ${cut -c1-8} should be a "command substitution" in the syntax $(cut -c1-8) but needs an input file to work upon.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
im a new student in programming and im stuck on this question so please please HELP ME. thanks.
the question is this:
enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies
3. Shell Programming and Scripting
Hi All ,
I want to delete files from /tmp directory created by "xxxx" id.
because i got the list says more than 60 thousand files were created by "xxxx" id since 2002.
The /tmp directory has lot of files created by different user ids like root,system etc..
But, i need a script to... (2 Replies)
Discussion started by: vparunkumar
2 Replies
4. Shell Programming and Scripting
I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y"
#!/bin/bash
du -hs $1
while read SIZE ENTRY
do
if ;
then
find $1 -mtime +$2 -exec rm -f {} \;
echo "Files older than $2 days deleted"
else
echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 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
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
7. Shell Programming and Scripting
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies
8. Shell Programming and Scripting
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies
9. Shell Programming and Scripting
find "*.c" and "Makefile" and then delete them with one line (3 Replies)
Discussion started by: yanglei_fage
3 Replies
10. 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
LEARN ABOUT ULTRIX
uuclean
uuclean(8c) uuclean(8c)
Name
uuclean - uucp spool directory clean-up
Syntax
uuclean -p[pre] [ options ... ]
Description
The command scans the spool directory for files with the specified prefix and deletes all those which are older than the specified number
of hours.
The -ppre argument causes the command to scan for files with pre as the file prefix. You can specify up to 10 arguments. A without any
pre following causes all files older than the specified time to be deleted. You must specify at least one argument.
Options
-ntime Delete all files whose age is more than time, in hours, (default is 72 hours) and that have the specified pre as their file
prefix.
-m Send mail to the owner of the file when it is deleted.
-ssystem Delete files in all directories that are subdirectories of the per system spool directory that exists for system. If ALL is
specified, then all system directories are processed. ALL is the default.
-ddirectory Delete files that reside in the named directory. The default directory is The option over rides the option.
The command typically starts the program. In earlier versions, a deleted work file (C.file) would result in mail to the owner of the work
file, regardless of the option. Now, notification of deleted work files is sent to the user ID "uucp". If the option is used, mail is
also sent to the owner.
Examples
Here are some example command lines:
# uuclean -pLTMP. -pLOG. -n4 -d/usr/spool/uucp
# uuclean -d/usr/spool/uucp/.XQTDIR -p -n
# uuclean -smarkie -p -n84
The third example deletes all files for the system that are older than 84 hours.
Files
Directory with commands used by uuclean internally
See Also
uucp(1c), uux(1c), cron(8)
uuclean(8c)